using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using HoWave.Web.DataHelper;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_Audit : Admin, IRequiresSessionState
{
	private ToCashBLL _cash = null;
	protected Label lblUserName;
	protected HiddenField HiddenField1;
	protected Label lblToCashMoney;
	protected Label lblTChApplyTime;
	protected Label lblBalance;
	protected Label lblFreezeMoney;
	protected Label lblNumberType;
	protected Label lblTCAccoutID;
	protected Label lblTCAccountName;
	protected HtmlInputText txtTCNumber;
	protected RadioButton rdo1;
	protected RadioButton rdo2;
	protected RadioButton rdo3;
	protected Button btnOK;
	protected ToCashBLL To_cash
	{
		get
		{
			ToCashBLL cash;
			if (this._cash == null)
			{
				this._cash = new ToCashBLL(this.conn);
				cash = this._cash;
			}
			else
			{
				cash = this._cash;
			}
			return cash;
		}
	}
	public string ChashID
	{
		get
		{
			return (string)this.ViewState["chashID"];
		}
		set
		{
			this.ViewState["chashID"] = value;
		}
	}
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			if (!base.admin.CheckAdminPower(6))
			{
				base.WriteLog("Audit", Language.GetAdminMsg("Log/Access", "0"), "Tocash");
				base.WriteRightErrMsg();
			}
			string text = base.Request.QueryString["ID"].ToString();
			this.ChashID = text;
			DataTable toChashByToChashID = this.To_cash.GetToChashByToChashID(text);
			this.lblBalance.Text = toChashByToChashID.Rows[0]["Balance"].ToString();
			this.lblFreezeMoney.Text = toChashByToChashID.Rows[0]["FreezeMoney"].ToString();
			this.lblNumberType.Text = toChashByToChashID.Rows[0]["NumberType"].ToString();
			this.lblTCAccountName.Text = toChashByToChashID.Rows[0]["TCAccountName"].ToString();
			this.lblTCAccoutID.Text = toChashByToChashID.Rows[0]["TCAccoutID"].ToString();
			this.lblTChApplyTime.Text = toChashByToChashID.Rows[0]["TChApplyTime"].ToString();
			this.lblToCashMoney.Text = toChashByToChashID.Rows[0]["ToCashMoney"].ToString();
			this.lblUserName.Text = toChashByToChashID.Rows[0]["UserName"].ToString();
			this.HiddenField1.Value = toChashByToChashID.Rows[0]["UserID"].ToString();
			string a = toChashByToChashID.Rows[0]["TCStuate"].ToString();
			if (a == "1")
			{
				this.rdo1.Checked = true;
			}
			else
			{
				if (a == "2")
				{
					this.rdo2.Checked = true;
				}
				else
				{
					if (a == "3")
					{
						this.rdo3.Checked = true;
					}
				}
			}
		}
	}
	protected void btnOK_Click(object sender, EventArgs e)
	{
		HL_AdminToCash hL_AdminToCash = new HL_AdminToCash();
		hL_AdminToCash.NumberType = this.lblNumberType.Text;
		hL_AdminToCash.TCAccountName = this.lblTCAccountName.Text;
		hL_AdminToCash.TCAccoutID = this.lblTCAccoutID.Text;
		hL_AdminToCash.TCExamineTime = Convert.ToDateTime(DateTime.Now.ToUniversalTime()).ToString();
		hL_AdminToCash.TChApplyTime = Convert.ToDateTime(this.lblTChApplyTime.Text);
		hL_AdminToCash.ToCashMoney = Convert.ToDouble(this.lblToCashMoney.Text);
		hL_AdminToCash.TCNumber = this.txtTCNumber.Value;
		if (this.rdo1.Checked)
		{
			hL_AdminToCash.TCStuate = 1;
		}
		else
		{
			if (this.rdo2.Checked)
			{
				hL_AdminToCash.TCStuate = 2;
			}
			else
			{
				if (this.rdo3.Checked)
				{
					hL_AdminToCash.TCStuate = 3;
				}
			}
		}
		hL_AdminToCash.ToCashID = this.ChashID;
		hL_AdminToCash.UserID = this.HiddenField1.Value.ToInt32(new int[0]);
		bool updateToChashByToChashIDTransaction = this.To_cash.GetUpdateToChashByToChashIDTransaction(hL_AdminToCash);
		if (updateToChashByToChashIDTransaction)
		{
			this.WriteSuccessMsg("", "操作成功！", "Admin_ToCash.aspx");
		}
	}
}
